<template>
	<view class="uni-tab-bar">
		 <scroll-view scroll-x class="uni-swiper-tab" :style="scrollstyle">
			 <block v-for="(tab,index) in tabBars" :key="tab.id">
				 <!-- 触摸事件就是要滑动切换页面这个 -->
			  <view class="swiper-tab-list " :class="{'active':tabindex==index}" @tap="tabtap(index)" :style="scrollitem">
				  {{tab.name}} {{tab.num?tab.num:''}}
				  <view class="swiper-tab-line"></view>
				  </view>
				  </block>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props:{
			tabBars:Array,
			tabindex:Number,
			scrollstyle:{
				type:String,
				default:""
			},
			scrollitem:{
				type:String,
				default:""
			}
		},
		methods: {
			tabtap(index){
				this.$emit('tabtap',index);
				
			}
			}
		
	}
</script>

<style scoped>
	.swiper-tab-list {
		color:#969696;
		font-weight: bold;
	}
	.uni-tab-bar{
		border-bottom: 1upx solid #eeeeeeeeeeee;
		
	}
	.uni-tab-bar .active{
		color: #343434;
		/* background-color: #BEBEBE; */
		border-radius: 10upx;
	}
	.active .swiper-tab-line{
		border-bottom: 6upx solid #fede33;
		width: 70upx;
		margin: auto;
		border-top: 6upx solid #FEDE33;
		border-radius:10upx ;
	}
	/* .swiper-box{
		height: 1000upx !important;
	} */
</style>
